package easy;

public class Solution_1446 {

    public int maxPower(String s) {
        s += " ";
        int max = 1;
        for (int i = 1, count = 1; i < s.length(); i++) {
            if (s.charAt(i) != s.charAt(i - 1)) {
                max = Math.max(max, count);
                count = 1;
            } else {
                count++;
            }
        }
        return max;
    }

    public static void main(String[] args) {
        Solution_1446 model = new Solution_1446();
        System.out.println(model.maxPower("leetcode"));
        System.out.println(model.maxPower("abbcccddddeeeeedcba"));
        System.out.println(model.maxPower("triplepillooooow"));
        System.out.println(model.maxPower("hooraaaaaaaaaaay"));
        System.out.println(model.maxPower("tourist"));
    }
}
